from typing import List
class Solution:
    def matchPlayersAndTrainers(self, players: List[int], trainers: List[int]) -> int:
        players.sort()
        trainers.sort()
        t_idx = 0
        p_idx = 0
        ret = 0
        while t_idx < len(trainers):
            if p_idx == len(players):
                break
            if players[p_idx] <= trainers[t_idx]:
                ret += 1
                p_idx += 1
                t_idx += 1
            else:
                t_idx += 1

        return ret
        